<html>
<head>
	 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>一人一本 - 下一期团购</title>

    <!--<link href="css/bootstrap.css" rel="stylesheet">-->
	<!--<link href="css/bootstrap-responsive.min.css" rel="stylesheet">-->
	<link href="css/productlist.css" rel="stylesheet">
	<link href="css/inspiritas.css" rel="stylesheet">
	<link href="css/carousel.css" rel="stylesheet">
	<script src="js/jquery-1.7.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.form.js"></script>
    <script src="js/jquery.json-2.4.js"></script>
	<script>
	$(document).ready(	
		function()
		{
			typeListClick();
			var tt=1;
			for (var i=0;i<1000000000;i++)
				tt++;

			<?php include "htm/ready.htm";?>

			$.ajax({
				url:'index.php?act=groupbuy.next_group_buy',
				type:'POST',
				success:function(data){
					//alert(data);
				}
			});

			$.getJSON('index.php?act=groupbuy.next_group_buy', function(data){
				$('#group_image').attr("src",data.ImagePath); 
				$('#hour_remaining').text(data.hour); 
				

			});

			$.getJSON('index.php?act=groupbuy.next_group_buy_product', function(data){
				var i=0;
				var html = "";
				for(var product in data)
				{
					if (i>0 && i%5==0) {
						html = html + '<div class="span1"></div></div>';
					}
					if (i%5==0) {
						html = html + '<div class="row-fluid product-row"><div class="span1"></div>';
					}
					html = html +
					'<div id="BOOK_ID_00001" class="span2">'+
					'<a href="' + 'productDetail.php?product_id=' + data[product].ID + '">'+
					'<img src="'+data[product].IMAGE+'" class="img-rounded" width="160">'+
					'</a>'+
					'<div class="book-info-list">'+
					'<a href="' + 'productDetail.php?product_id=' + data[product].ID + '" class="book-name-list">'+data[product].Name+'</a>'+
					'<div id="authors">'+
					'<span class="carat juicy">›</span>'+
					'<a class="text-normal" href="#">'+data[product].Author+'</a>'+
					'</div>'+
					'<div class="smoke">平装</div>'+
					'<span class="grey book-price-old">￥&nbsp;'+data[product].Price+'</span>'+
					'<span class="red book-price-new">￥&nbsp;'+data[product].current_price+'</span>'+
					'</div>'+
					'</div>';
					i++;
				}
				if (i>0) {
					html = html+'</div>';
				}
				$('#product_list').append(html);
			}
		);
		}
	);
	
	function typeListClick()
	{
		$('#type-list').children(':not(".divider,h2")').click(function(){
			$(this).addClass('active');
			$(this).siblings().removeClass('active');
		});
	}
	</script>
</head>
<body>

<?php include "htm/head.htm";?>

<div class="row-fluid product-row">
	<div class="span2"></div>
	<img id="group_image" src="img\discount\" >
</div>
<hr class="type-seperator">
<div class="span4 "></div>
<div id="time_remaining">
	<img src="img/距离开始还有.jpg" style="margin-top:-20px">
	<span id="hour_remaining" style="font-size:300%;color:green;"></span>
	<img src="img/小时.jpg" style="margin-top:-20px">
	<a href="currentgroupbuy.php"><img src="img/回到当前团购.jpg" style="margin-top:-20px"></a>
</div>

<div class="row-fluid product-row">
    <div class="span1 "></div>
	
</div>

<div class="row-fluid product-row">
      <div id="product_list"></div>
</div>
 
<?php include "htm/footer.htm";?>
<?php include "htm/copyright.htm";?>
 
</body>
</html>